# coding=utf-8
"""
Tencent is pleased to support the open source community by making BK-ITSM 蓝鲸流程服务 available.

Copyright (C) 2021 THL A29 Limited, a Tencent company.  All rights reserved.

BK-ITSM 蓝鲸流程服务 is licensed under the MIT License.

License for BK-ITSM 蓝鲸流程服务:
--------------------------------------------------------------------
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""

from django.utils.translation import ugettext as _

from itsm.component.constants import (
    EMAIL,
    FINISHED,
    FOLLOW_OPERATE,
    INVITE_OPERATE,
    SMS,
    SUPERVISE_OPERATE,
    SUSPEND_OPERATE,
    TERMINATE_OPERATE,
    TRANSITION_OPERATE,
    UNSUSPEND_OPERATE,
    WEIXIN,
    WAITING_FOR_OPERATE,
    WAITING_FOR_CONFIRM,
    NOTIFY_FOLLOWER_OPERATE,
)
from itsm.sla.constants import (
    SLA_HANDLE_WARNING_NOTIFY,
    SLA_HANDLE_WARNING_TEMPLATE_SMS,
    SLA_HANDLE_WARNING_TEMPLATE_WEIXIN,
    SLA_HANDLE_WARNING_TEMPLATE_EMAIL,
    SLA_HANDLE_WARNING_NOTIFY_TITLE,
    SLA_HANDLE_OVERTIME_NOTIFY_TITLE,
    SLA_HANDLE_OVERTIME_TEMPLATE_EMAIL,
    SLA_HANDLE_OVERTIME_TEMPLATE_SMS,
    SLA_HANDLE_OVERTIME_TEMPLATE_WEIXIN,
    SLA_HANDLE_OVERTIME_NOTIFY,
    SLA_REPLY_WARNING_NOTIFY,
    SLA_REPLY_WARNING_TEMPLATE_EMAIL,
    SLA_REPLY_WARNING_TEMPLATE_SMS,
    SLA_REPLY_WARNING_TEMPLATE_WEIXIN,
    SLA_REPLY_WARNING_NOTIFY_TITLE,
    SLA_REPLY_OVERTIME_NOTIFY,
    SLA_REPLY_OVERTIME_TEMPLATE_WEIXIN,
    SLA_REPLY_OVERTIME_TEMPLATE_SMS,
    SLA_REPLY_OVERTIME_TEMPLATE_EMAIL,
    SLA_REPLY_OVERTIME_NOTIFY_TITLE,
)

ACTION_CHOICES = [
    (TERMINATE_OPERATE, _("单据终止通知")),
    (FOLLOW_OPERATE, _("邀请关注通知")),
    (INVITE_OPERATE, _("邀请评价通知")),
    (SUPERVISE_OPERATE, _("单据督办通知")),
    (SUSPEND_OPERATE, _("单据挂起通知")),
    (UNSUSPEND_OPERATE, _("单据恢复通知")),
    (TRANSITION_OPERATE, _("单据待办通知")),
    (WAITING_FOR_OPERATE, _("任务待办通知")),
    (WAITING_FOR_CONFIRM, _("任务待总结通知")),
    (NOTIFY_FOLLOWER_OPERATE, _("关注人通知")),
    (FINISHED, _("单据结束通知")),
    (SLA_HANDLE_WARNING_NOTIFY, _("SLA服务处理预警提醒通知")),
    (SLA_HANDLE_OVERTIME_NOTIFY, _("SLA服务处理超时提醒通知")),
    (SLA_REPLY_WARNING_NOTIFY, _("SLA服务响应预警提醒通知")),
    (SLA_REPLY_OVERTIME_NOTIFY, _("SLA服务响应超时提醒")),
]
ACTION_CHOICES_DICT = dict(ACTION_CHOICES + [(FINISHED, _("已完成"))])

SUPERVISE_MESSAGE = '您的单据(${title})还没处理完成，请及时处理！'

TASK_EMAIL_TEMPLATE = """
<div style="height:650px;">
    <div class="title">
        <img class="logo"
             src="">
    </div>
    <div class="center">
        <div class="table">
            <div style="font-size：20px; border-bottom：1px solid #dedede">
                <div style="margin：10px 0 10px 20px">
                    <span style="font-weight：bold">【ITSM通知】</span><span>${service_type_name}</span>
                </div>
            </div>
            <div style="margin：30px 0 10px 30px">
                <p>HI,您好！</p>
                <p>您有<span style="color：#6eb5fe">1</span>个${service_type_name}任务【${action}】</p>

                <p>标题：${title}</p>
                <p>单号：${sn}</p>
                <p>服务目录：${catalog_service_name}</p>
                <p>当前环节：${running_status}</p>
                <p>任务名称：${task_name}</p>
                <p>任务类型：${task_component_type_display}</p>
                <p>任务阶段：${task_status_display}</p>
                <p>任务创建人：${task_creator}</p>
                <p>任务创建时间：${task_create_at}</p>

                <p><a href="${ticket_url}">点击查看详情</a></p>
                <br><br>
                <p>如有任何问题，可随时联系ITSM助手。</p>

                <div style="float：right;margin-right：50px">
                    <p>ITSM流程管理服务</p>
                    <span style="float：right">${today_date.year}年${today_date.month}月${today_date.day}日</span>
                </div>
            </div>
        </div>
    </div>
</div>

"""

EMAIL_TEMPLATE = """
<div style="height:650px;">
    <div class="title">
        <img class="logo"
             src="">
    </div>
    <div class="center">
        <div class="table">
            <div style="font-size：20px; border-bottom：1px solid #dedede">
                <div style="margin：10px 0 10px 20px">
                    <span style="font-weight：bold">【ITSM通知】</span><span>${service_type_name}</span>
                </div>
            </div>
            <div style="margin：30px 0 10px 30px">
                <p>HI,您好！</p>
                <p>您有<span style="color：#6eb5fe">1</span>条${service_type_name}单【${action}】</p>

                <p>标题：${title}</p>
                <p>单号：${sn}</p>
                <p>服务目录：${catalog_service_name}</p>
                <p>当前环节：${running_status}</p>

                <p><a href="${ticket_url}">点击查看详情</a></p>
                <br><br>
                <p>如有任何问题，可随时联系ITSM助手。</p>

                <div style="float：right;margin-right：50px">
                    <p>ITSM流程管理服务</p>
                    <span style="float：right">${today_date.year}年${today_date.month}月${today_date.day}日</span>
                </div>
            </div>
        </div>
    </div>
</div>

"""

FOLLOW_EMAIL_TEMPLATE = """
<div style="height:650px;">
    <div class="title">
    </div>
    <div class="center">
        <div class="table">
            <div style="font-size：20px; border-bottom：1px solid #dedede">
                <div style="margin：10px 0 10px 20px">
                    <span style="font-weight：bold">【ITSM通知】</span><span>${service_type_name}</span>
                </div>
            </div>
            <div style="margin：30px 0 10px 30px">
                <p>HI,您好！</p>
                 <span>您有需要关注的单据，请关注</span>
                 <p>标题：${title}</p>
                 <p>单号：${sn}</p>
                 <p>服务目录：${catalog_service_name}</p>
                 <p>当前环节：${running_status}</p>
                 <p>关注信息：${message}</p>
                <p><a href="${ticket_url}">点击查看详情</a></p>
                <br><br>
                <p>如有任何问题，可随时联系ITSM助手。</p>

                <div style="float：right;margin-right：50px">
                    <p>ITSM流程管理服务</p>
                    <span style="float：right">${today_date.year}年${today_date.month}月${today_date.day}日</span>
                </div>
            </div>
        </div>
    </div>
</div>

"""
SUPERVISE_EMAIL_TEMPLATE = """
<div style="height:650px;">
    <div class="title">
        <img class="logo"
             src="">
    </div>
    <div class="center">
        <div class="table">
            <div style="font-size：20px; border-bottom：1px solid #dedede">
                <div style="margin：10px 0 10px 20px">
                    <span style="font-weight：bold">【ITSM通知】</span><span>${service_type_name}</span>
                </div>
            </div>
            <div style="margin：30px 0 10px 30px">
                <p>HI,您好！</p>
                <p>${message}</p>

                <p>标题：${title}</p>
                <p>单号：${sn}</p>
                <p>服务目录：${catalog_service_name}</p>
                <p>当前环节：${running_status}</p>
                <p><a href="${ticket_url}">点击查看详情</a></p>
                <br><br>
                <p>如有任何问题，可随时联系ITSM助手。</p>

                <div style="float：right;margin-right：50px">
                    <p>ITSM流程管理服务</p>
                    <span style="float：right">${today_date.year}年${today_date.month}月${today_date.day}日</span>
                </div>
            </div>
        </div>
    </div>
</div>

"""
INVITE_EMAIL_TEMPLATE = """
<div style="height:650px;">
    <div class="title">
    </div>
    <div class="center">
        <div class="table">
            <div style="font-size：20px; border-bottom：1px solid #dedede">
                <div style="margin：10px 0 10px 20px">
                    <span style="font-weight：bold">【ITSM邀请评价】</span>
                </div>
            </div>
            <div style="margin：30px 0 10px 30px">
                <p>HI,您好！您的需求(${title})已经处理完成，现邀请您为我们的服务进行评价。您的反馈对我们非常重要！感谢回复与建议，祝您工作愉快！</p>
                <p><a href="${ticket_url}">点击查看详情</a></p>
                <br><br>
                <p>如有任何问题，可随时联系ITSM助手。</p>

                <div style="float：right;margin-right：50px">
                    <p>ITSM流程管理服务</p>
                    <span style="float：right">${today_date.year}年${today_date.month}月${today_date.day}日</span>
                </div>
            </div>
        </div>
    </div>
</div>
"""
OPERATE_EMAIL_TEMPLATE = """
<div style="height:650px;">
    <div class="title">
    </div>
    <div class="center">
        <div class="table">
            <div style="font-size：20px; border-bottom：1px solid #dedede">
                <div style="margin：10px 0 10px 20px">
                    <span style="font-weight：bold">【ITSM通知】</span><span>${service_type_name}</span>
                </div>
            </div>
            <div style="margin：30px 0 10px 30px">
                <p>您好！您所申请的单据被【${action}！】</p>
                <P>标题：${title}</P>
                <P>单号：${sn}</P>
                <p>服务目录：${catalog_service_name}</p>
                <P>${message}</P>
                <p><a href="${ticket_url}">点击查看详情</a></p>
                <br><br>
                <p>如有任何问题，可随时联系ITSM助手。</p>

                <div style="float：right;margin-right：50px">
                    <p>ITSM流程管理服务</p>
                    <span style="float：right">${today_date.year}年${today_date.month}月${today_date.day}日</span>
                </div>
            </div>
        </div>
    </div>
</div>
"""

CSS_TEMPLATE = """

<style type="text/css">
    body {
        background-color：#f7f7f7;
        margin：0px;
    }

    .logo {
        margin：10px 10px 10px 20px
    }

    .title {
        background-color：#3c96ff;
        width：100%;
        height：52px;
    }

    .center {
        width：96%;
        height：500px;
        margin：auto;
        position：absolute;
        padding：20px;
    }

    .table {
        border：1px solid #dedede;
        width：100%;
        height：550px;
        background-color：white;
    }
</style>
"""

TASK_SMS_CONTENT_COMMON = TASK_WEIXIN_CONTENT_COMMON = '''
 标题：${title}
 单号：<a href="${ticket_url}">${sn}</a>
 任务名称：${task_name}
 任务类型：${task_component_type_display}
 任务状态：${task_status_display}
 任务创建人：${task_creator}
 任务创建时间：${task_create_at}
 ${message}'''

SMS_CONTENT_COMMON = WEIXIN_CONTENT_COMMON = '''
 标题：${title}
  单号：<a href="${ticket_url}">${sn}</a>
 ${message}'''

SMS_CONTENT_DONE = WEIXIN_CONTENT_DONE = '''您的需求(${title})已经处理完成，现邀请您为我们的服务进行评价。您的反馈对我们非常重要！感谢回复与建议，祝您工作愉快！
 ${ticket_url}'''

SMS_CONTENT_FOLLOW = WEIXIN_CONTENT_FOLLOW = ''' 你有一条${service_type_name}工单需要关注
 标题：${title}
 单号：<a href="${ticket_url}">${sn}</a>
 服务目录：${catalog_service_name}
 当前环节：${running_status}'''

SMS_CONTENT_OPERATE = '''
 标题：${title}
 单号：${sn}
 服务目录：${catalog_service_name}
 当前环节：${running_status}'''

WEIXIN_CONTENT_OPERATE = '''
 标题：${title}
 单号：<a href="${ticket_url}">${sn}</a>
 服务目录：${catalog_service_name}
 当前环节：${running_status}
 '''

ATTENTION_SMS_CONTENT_COMMON = ATTENTION_WEIXIN_CONTENT_COMMON = '''
 标题：${title}
 单号：${sn}
 服务：${catalog_service_name}
 当前步骤：${running_status}
 当前处理人：${ticket_current_processors}
 查看详情：${ticket_url}'''

ATTENTION_EMAIL_TEMPLATE = """
<div style="height:650px;">
    <div class="title">
        <img class="logo"
             src="">
    </div>
    <div class="center">
        <div class="table">
            <div style="font-size：20px; border-bottom：1px solid #dedede">
                <div style="margin：10px 0 10px 20px">
                    <span style="font-weight：bold">【ITSM通知】</span>
                </div>
            </div>
            <div style="margin：30px 0 10px 30px">
                <p>HI,您好！</p>
                <p>您关注的单据动态有更新</p>

                <p>标题：${title}</p>
                <p>单号：${sn}</p>
                <p>服务：${catalog_service_name}</p>
                <p>当前步骤：${running_status}</p>
                <p>当前处理人：${ticket_current_processors}</p>
                <p><a href="${ticket_url}">点击查看详情</a></p>
                <br><br>
                <p>如有任何问题，可随时联系ITSM助手。</p>

                <div style="float：right;margin-right：50px">
                    <p>ITSM流程管理服务</p>
                    <span style="float：right">${today_date.year}年${today_date.month}月${today_date.day}日</span>
                </div>
            </div>
        </div>
    </div>
</div>

"""

NOTIFY_TITLE_COMMON = "『ITSM』${service_type_name}单【${action}】"
TASK_NOTIFY_TITLE_COMMON = "『ITSM』${service_type_name}单任务【${action}】"
ATTENTION_TITLE_COMMON = "『ITSM』您关注的单据动态有更新"

NOTIFY_TEMPLATE = [
    # title_template content_template action notify_type used_by
    (NOTIFY_TITLE_COMMON, ''' ${message}''', SUPERVISE_OPERATE, SMS, "TICKET"),
    (NOTIFY_TITLE_COMMON, SMS_CONTENT_DONE, INVITE_OPERATE, SMS, "TICKET"),
    (NOTIFY_TITLE_COMMON, SMS_CONTENT_DONE, FINISHED, SMS, "TICKET"),
    (NOTIFY_TITLE_COMMON, SMS_CONTENT_COMMON, TERMINATE_OPERATE, SMS, "TICKET"),
    (NOTIFY_TITLE_COMMON, SMS_CONTENT_COMMON, SUSPEND_OPERATE, SMS, "TICKET"),
    (NOTIFY_TITLE_COMMON, SMS_CONTENT_COMMON, UNSUSPEND_OPERATE, SMS, "TICKET"),
    (NOTIFY_TITLE_COMMON, SMS_CONTENT_FOLLOW, FOLLOW_OPERATE, SMS, "TICKET"),
    (NOTIFY_TITLE_COMMON, SMS_CONTENT_OPERATE, TRANSITION_OPERATE, SMS, "TICKET"),
    (TASK_NOTIFY_TITLE_COMMON, TASK_SMS_CONTENT_COMMON, WAITING_FOR_OPERATE, SMS, "TASK"),
    (TASK_NOTIFY_TITLE_COMMON, TASK_SMS_CONTENT_COMMON, WAITING_FOR_CONFIRM, SMS, "TASK"),
    (ATTENTION_TITLE_COMMON, ATTENTION_SMS_CONTENT_COMMON, NOTIFY_FOLLOWER_OPERATE, SMS, "TICKET"),
    (NOTIFY_TITLE_COMMON, ''' ${message}''', SUPERVISE_OPERATE, WEIXIN, "TICKET"),
    (NOTIFY_TITLE_COMMON, WEIXIN_CONTENT_DONE, INVITE_OPERATE, WEIXIN, "TICKET"),
    (NOTIFY_TITLE_COMMON, WEIXIN_CONTENT_DONE, FINISHED, WEIXIN, "TICKET"),
    (NOTIFY_TITLE_COMMON, WEIXIN_CONTENT_COMMON, TERMINATE_OPERATE, WEIXIN, "TICKET"),
    (NOTIFY_TITLE_COMMON, WEIXIN_CONTENT_COMMON, SUSPEND_OPERATE, WEIXIN, "TICKET"),
    (NOTIFY_TITLE_COMMON, WEIXIN_CONTENT_COMMON, UNSUSPEND_OPERATE, WEIXIN, "TICKET"),
    (NOTIFY_TITLE_COMMON, WEIXIN_CONTENT_FOLLOW, FOLLOW_OPERATE, WEIXIN, "TICKET"),
    (NOTIFY_TITLE_COMMON, WEIXIN_CONTENT_OPERATE, TRANSITION_OPERATE, WEIXIN, "TICKET"),
    (TASK_NOTIFY_TITLE_COMMON, TASK_WEIXIN_CONTENT_COMMON, WAITING_FOR_OPERATE, WEIXIN, "TASK"),
    (TASK_NOTIFY_TITLE_COMMON, TASK_WEIXIN_CONTENT_COMMON, WAITING_FOR_CONFIRM, WEIXIN, "TASK"),
    (ATTENTION_TITLE_COMMON, ATTENTION_WEIXIN_CONTENT_COMMON, NOTIFY_FOLLOWER_OPERATE, WEIXIN, "TICKET"),
    (NOTIFY_TITLE_COMMON, INVITE_EMAIL_TEMPLATE + CSS_TEMPLATE, INVITE_OPERATE, EMAIL, "TICKET"),
    (NOTIFY_TITLE_COMMON, INVITE_EMAIL_TEMPLATE + CSS_TEMPLATE, FINISHED, EMAIL, "TICKET"),
    (NOTIFY_TITLE_COMMON, FOLLOW_EMAIL_TEMPLATE + CSS_TEMPLATE, FOLLOW_OPERATE, EMAIL, "TICKET"),
    (NOTIFY_TITLE_COMMON, OPERATE_EMAIL_TEMPLATE + CSS_TEMPLATE, TERMINATE_OPERATE, EMAIL, "TICKET"),
    (NOTIFY_TITLE_COMMON, OPERATE_EMAIL_TEMPLATE + CSS_TEMPLATE, SUSPEND_OPERATE, EMAIL, "TICKET"),
    (NOTIFY_TITLE_COMMON, OPERATE_EMAIL_TEMPLATE + CSS_TEMPLATE, UNSUSPEND_OPERATE, EMAIL, "TICKET"),
    (NOTIFY_TITLE_COMMON, EMAIL_TEMPLATE + CSS_TEMPLATE, TRANSITION_OPERATE, EMAIL, "TICKET"),
    (NOTIFY_TITLE_COMMON, SUPERVISE_EMAIL_TEMPLATE + CSS_TEMPLATE, SUPERVISE_OPERATE, EMAIL, "TICKET"),
    (TASK_NOTIFY_TITLE_COMMON, TASK_EMAIL_TEMPLATE + CSS_TEMPLATE, WAITING_FOR_OPERATE, EMAIL, "TASK"),
    (TASK_NOTIFY_TITLE_COMMON, TASK_EMAIL_TEMPLATE + CSS_TEMPLATE, WAITING_FOR_CONFIRM, EMAIL, "TASK"),
    (ATTENTION_TITLE_COMMON, ATTENTION_EMAIL_TEMPLATE, NOTIFY_FOLLOWER_OPERATE, EMAIL, "TICKET"),
    # SLA通知模板
    (SLA_HANDLE_WARNING_NOTIFY_TITLE, SLA_HANDLE_WARNING_TEMPLATE_EMAIL, SLA_HANDLE_WARNING_NOTIFY, EMAIL, "SLA"),
    (SLA_HANDLE_WARNING_NOTIFY_TITLE, SLA_HANDLE_WARNING_TEMPLATE_SMS, SLA_HANDLE_WARNING_NOTIFY, SMS, "SLA"),
    (SLA_HANDLE_WARNING_NOTIFY_TITLE, SLA_HANDLE_WARNING_TEMPLATE_WEIXIN, SLA_HANDLE_WARNING_NOTIFY, WEIXIN, "SLA"),
    (SLA_HANDLE_OVERTIME_NOTIFY_TITLE, SLA_HANDLE_OVERTIME_TEMPLATE_EMAIL, SLA_HANDLE_OVERTIME_NOTIFY, EMAIL, "SLA"),
    (SLA_HANDLE_OVERTIME_NOTIFY_TITLE, SLA_HANDLE_OVERTIME_TEMPLATE_SMS, SLA_HANDLE_OVERTIME_NOTIFY, SMS, "SLA"),
    (SLA_HANDLE_OVERTIME_NOTIFY_TITLE, SLA_HANDLE_OVERTIME_TEMPLATE_WEIXIN, SLA_HANDLE_OVERTIME_NOTIFY, WEIXIN, "SLA"),
    (SLA_REPLY_WARNING_NOTIFY_TITLE, SLA_REPLY_WARNING_TEMPLATE_EMAIL, SLA_REPLY_WARNING_NOTIFY, EMAIL, "SLA"),
    (SLA_REPLY_WARNING_NOTIFY_TITLE, SLA_REPLY_WARNING_TEMPLATE_SMS, SLA_REPLY_WARNING_NOTIFY, SMS, "SLA"),
    (SLA_REPLY_WARNING_NOTIFY_TITLE, SLA_REPLY_WARNING_TEMPLATE_WEIXIN, SLA_REPLY_WARNING_NOTIFY, WEIXIN, "SLA"),
    (SLA_REPLY_OVERTIME_NOTIFY_TITLE, SLA_REPLY_OVERTIME_TEMPLATE_EMAIL, SLA_REPLY_OVERTIME_NOTIFY, EMAIL, "SLA"),
    (SLA_REPLY_OVERTIME_NOTIFY_TITLE, SLA_REPLY_OVERTIME_TEMPLATE_SMS, SLA_REPLY_OVERTIME_NOTIFY, SMS, "SLA"),
    (SLA_REPLY_OVERTIME_NOTIFY_TITLE, SLA_REPLY_OVERTIME_TEMPLATE_WEIXIN, SLA_REPLY_OVERTIME_NOTIFY, WEIXIN, "SLA"),
]


SWITCH_ON = "on"
SWITCH_OFF = "off"
SYS_FILE_PATH = "SYS_FILE_PATH"
ORGANIZATION_KEY = "IS_ORGANIZATION"
SERVICE_SWITCH = "SERVICE_SWITCH"
WIKI_SWITCH = "WIKI_SWITCH"
SLA_SWITCH = "SLA_SWITCH"
CHILD_TICKET_SWITCH = "CHILD_TICKET_SWITCH"
FLOW_PREVIEW = "FLOW_PREVIEW"
TRIGGER_SWITCH = 'TRIGGER_SWITCH'
TASK_SWITCH = 'TASK_SWITCH'
TABLE_FIELDS_SWITCH = 'TABLE_FIELDS_SWITCH'
FIRST_STATE_SWITCH = 'FIRST_STATE_SWITCH'
SMS_COMMENT_SWITCH = 'SMS_COMMENT_SWITCH'

DEFAULT_SETTINGS = [
    [SYS_FILE_PATH, "PATH", ""],
    [TABLE_FIELDS_SWITCH, "FUNCTION", SWITCH_OFF],
    [FIRST_STATE_SWITCH, "FUNCTION", SWITCH_OFF],
    [ORGANIZATION_KEY, "FUNCTION", SWITCH_ON],
    [SERVICE_SWITCH, "FUNCTION", SWITCH_ON],
    [WIKI_SWITCH, "FUNCTION", SWITCH_OFF],
    [CHILD_TICKET_SWITCH, "FUNCTION", SWITCH_OFF],
    [SLA_SWITCH, "FUNCTION", SWITCH_OFF],
    [FLOW_PREVIEW, "FUNCTION", SWITCH_ON],
    [TRIGGER_SWITCH, "FUNCTION", SWITCH_ON],
    [TASK_SWITCH, "FUNCTION", SWITCH_OFF],
    [SMS_COMMENT_SWITCH, "FUNCTION", SWITCH_OFF],
]


PROJECT_SETTING = [
    [TABLE_FIELDS_SWITCH, "FUNCTION", SWITCH_OFF],
    [FIRST_STATE_SWITCH, "FUNCTION", SWITCH_OFF],
    [ORGANIZATION_KEY, "FUNCTION", SWITCH_ON],
    [SERVICE_SWITCH, "FUNCTION", SWITCH_ON],
    [WIKI_SWITCH, "FUNCTION", SWITCH_OFF],
    [CHILD_TICKET_SWITCH, "FUNCTION", SWITCH_OFF],
    [SLA_SWITCH, "FUNCTION", SWITCH_OFF],
    [FLOW_PREVIEW, "FUNCTION", SWITCH_ON],
    [TRIGGER_SWITCH, "FUNCTION", SWITCH_ON],
    [TASK_SWITCH, "FUNCTION", SWITCH_OFF],
    [SMS_COMMENT_SWITCH, "FUNCTION", SWITCH_OFF],
]
